global root "C:\Users\hanwa\Desktop\replication"

use "$root\data\IMC_HA_Yearly_Panel_clean.dta", replace

***Column 1: Net admin cost
preserve
drop if startyear==-1
keep if cem_matched==1
stackedev lnexpend imc1 imc2 , cohort(startyear) time(region_y) never_treat(no_treat) unit_fe(code) clust_unit(code)  covariates (deficit_rate grant_dependence lnpop lnclaim lnwage  kids private umemploy pension vulnerable )
outreg2 using "$root\tables\table9", excel symbol(***,**,*) se replace
restore

use "$root\data\IMC_HA_Monthly_Panel_clean.dta", replace

***Column 2: Speed of new claims
preserve
drop if startdate==-1
keep if cem_matched==1
stackedev hb_newclaim_speed imc1 imc2, cohort(startdate) time(region_ym) never_treat(no_treat) unit_fe(code) clust_unit(code)  covariates (deficit_rate grant_dependence lnpop lnclaim lnwage  kids private umemploy pension vulnerable )
outreg2 using "$root\tables\table9", excel symbol(***,**,*) se append
restore

***Column 3: Speed of CoC
preserve
drop if startdate==-1
keep if cem_matched==1
stackedev hb_coc_speed imc1 imc2, cohort(startdate) time(region_ym) never_treat(no_treat) unit_fe(code) clust_unit(code)  covariates (deficit_rate grant_dependence lnpop lnclaim lnwage  kids private umemploy pension vulnerable )
outreg2 using "$root\tables\table9", excel symbol(***,**,*) se append
restore

use "$root\data\IMC_HA_Quarterly_Panel_clean.dta", replace

***Column 4: Debt identified
preserve
drop if startdate==-1
keep if cem_matched==1
stackedev identir imc1 imc2, cohort(startdate) time(region_yq) never_treat(no_treat) unit_fe(code) clust_unit(code)  covariates (deficit_rate grant_dependence lnpop lnclaim lnwage  kids private umemploy pension vulnerable )
outreg2 using "$root\tables\table9", excel symbol(***,**,*) se append
restore

***Column 5: Debt recovered
preserve
drop if startdate==-1
keep if cem_matched==1
stackedev recover imc1 imc2, cohort(startdate) time(region_yq) never_treat(no_treat) unit_fe(code) clust_unit(code)  covariates (deficit_rate grant_dependence lnpop lnclaim lnwage  kids private umemploy pension vulnerable )
outreg2 using "$root\tables\table9", excel symbol(***,**,*) se append
restore

***Column 6: Debt written Off
preserve
drop if startdate==-1
keep if cem_matched==1
stackedev writter imc1 imc2, cohort(startdate) time(region_yq) never_treat(no_treat) unit_fe(code) clust_unit(code)  covariates (deficit_rate grant_dependence lnpop lnclaim lnwage  kids private umemploy pension vulnerable )
outreg2 using "$root\tables\table9", excel symbol(***,**,*) se append
restore

***Column 7: Overall complaints
preserve
drop if startdate==-1
drop if startdate<=201301
keep if cem_matched==1
stackedev complain imc1 imc2, cohort(startdate) time(region_yq) never_treat(no_treat) unit_fe(code) clust_unit(code)  covariates (deficit_rate grant_dependence lnpop lnclaim lnwage  kids private umemploy pension vulnerable )
outreg2 using "$root\tables\table9", excel symbol(***,**,*) se append
restore

***Column 8: Upheld complaints
preserve
drop if startdate==-1
drop if startdate<=201301
keep if cem_matched==1
stackedev upheld imc1 imc2, cohort(startdate) time(region_yq) never_treat(no_treat) unit_fe(code) clust_unit(code)  covariates (deficit_rate grant_dependence lnpop lnclaim lnwage  kids private umemploy pension vulnerable )
outreg2 using "$root\tables\table9", excel symbol(***,**,*) se append
restore

